package file;

import java.io.FileInputStream;
import java.io.InputStream;

public class FileInputStreamDemo4 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("D:/temp/a.txt")){
            //read(byte[] b, int off, int len)
            byte[] buf = new byte[1024];
            while (true){
                int len = inputStream.read(buf,3,10);
                if (len == -1){
                    break;
                }
                for (int i = 0; i < len+3; i++) {
                    System.out.println(buf[i]);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
